
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.AdvanceServiceManager;
import Apusic.ApplicationManager;
import Apusic.ApusicPackage;
import Apusic.ApusicServer;
import Apusic.DataSourceManager;
import Apusic.JMSFactoryManager;
import Apusic.JMSQueueManager;
import Apusic.JMSTopicManager;
import Apusic.JVM;
import Apusic.OS;
import Apusic.SystemServiceManager;
import Apusic.ThreadPoolManager;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Server</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getOs <em>Os</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getJvm <em>Jvm</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getAppMgr <em>App Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getDsMgr <em>Ds Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getAdvServiceMgr <em>Adv Service Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getThreadPoolMgr <em>Thread Pool Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getSystemServiceMgr <em>System Service Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getJmsQueueMgr <em>Jms Queue Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getJmsTopicMgr <em>Jms Topic Mgr</em>}</li>
 *   <li>{@link Apusic.impl.ApusicServerImpl#getJmsFactoryMgr <em>Jms Factory Mgr</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ApusicServerImpl extends WrappingEObjectImpl implements ApusicServer
{
  /**
   * The cached value of the '{@link #getOs() <em>Os</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getOs()
   * @generated
   * @ordered
   */
  protected OS os;

  /**
   * The cached value of the '{@link #getJvm() <em>Jvm</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJvm()
   * @generated
   * @ordered
   */
  protected JVM jvm;

  /**
   * The cached value of the '{@link #getAppMgr() <em>App Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAppMgr()
   * @generated
   * @ordered
   */
  protected ApplicationManager appMgr;

  /**
   * The cached value of the '{@link #getDsMgr() <em>Ds Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDsMgr()
   * @generated
   * @ordered
   */
  protected DataSourceManager dsMgr;

  /**
   * The cached value of the '{@link #getAdvServiceMgr() <em>Adv Service Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAdvServiceMgr()
   * @generated
   * @ordered
   */
  protected AdvanceServiceManager advServiceMgr;

  /**
   * The cached value of the '{@link #getThreadPoolMgr() <em>Thread Pool Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getThreadPoolMgr()
   * @generated
   * @ordered
   */
  protected ThreadPoolManager threadPoolMgr;

  /**
   * The cached value of the '{@link #getSystemServiceMgr() <em>System Service Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSystemServiceMgr()
   * @generated
   * @ordered
   */
  protected SystemServiceManager systemServiceMgr;

  /**
   * The cached value of the '{@link #getJmsQueueMgr() <em>Jms Queue Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJmsQueueMgr()
   * @generated
   * @ordered
   */
  protected JMSQueueManager jmsQueueMgr;

  /**
   * The cached value of the '{@link #getJmsTopicMgr() <em>Jms Topic Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJmsTopicMgr()
   * @generated
   * @ordered
   */
  protected JMSTopicManager jmsTopicMgr;

  /**
   * The cached value of the '{@link #getJmsFactoryMgr() <em>Jms Factory Mgr</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJmsFactoryMgr()
   * @generated
   * @ordered
   */
  protected JMSFactoryManager jmsFactoryMgr;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ApusicServerImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.APUSIC_SERVER;
  }

  
  

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public Object lookupCore(){
    Object result=null;
    result="core";
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    Object core=(Object)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  
  
  
  
  
  
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OS getOs()
  {
    if (os != null && os.eIsProxy())
    {
      InternalEObject oldOs = (InternalEObject)os;
      os = (OS)eResolveProxy(oldOs);
      if (os != oldOs)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__OS, oldOs, os));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return os;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getSystemPropertyMgr(localsc).fetchOSConfig();
    OSImpl os=new OSImpl();
     os.setCore(result);
     result=os;
}
catch(Exception e)
{
  result = null;
}
        os=(result instanceof EObject)?(OS)result:(OS)ImagePool.find(result);
        	
    return os; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OS basicGetOs()
  {
    return os;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setOs(OS newOs)
  {
    OS oldOs = os;
    os = newOs;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__OS, oldOs, os));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JVM getJvm()
  {
    if (jvm != null && jvm.eIsProxy())
    {
      InternalEObject oldJvm = (InternalEObject)jvm;
      jvm = (JVM)eResolveProxy(oldJvm);
      if (jvm != oldJvm)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__JVM, oldJvm, jvm));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return jvm;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getSystemPropertyMgr(localsc).fetchVMConfig();
    JVMImpl jvm=new JVMImpl();
     jvm.setCore(result);
     result=jvm;
}
catch(Exception e)
{
  result = null;
}
        jvm=(result instanceof EObject)?(JVM)result:(JVM)ImagePool.find(result);
        	
    return jvm; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JVM basicGetJvm()
  {
    return jvm;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJvm(JVM newJvm)
  {
    JVM oldJvm = jvm;
    jvm = newJvm;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__JVM, oldJvm, jvm));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ApplicationManager getAppMgr()
  {
    if (appMgr != null && appMgr.eIsProxy())
    {
      InternalEObject oldAppMgr = (InternalEObject)appMgr;
      appMgr = (ApplicationManager)eResolveProxy(oldAppMgr);
      if (appMgr != oldAppMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__APP_MGR, oldAppMgr, appMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return appMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getApplicationMgr(localsc);
     ApplicationManagerImpl ami=new ApplicationManagerImpl();
     ami.setCore(result);
     result=ami;
}
catch(Exception e)
{
  result = null;
}
        appMgr=(result instanceof EObject)?(ApplicationManager)result:(ApplicationManager)ImagePool.find(result);
        	
    return appMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ApplicationManager basicGetAppMgr()
  {
    return appMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAppMgr(ApplicationManager newAppMgr)
  {
    ApplicationManager oldAppMgr = appMgr;
    appMgr = newAppMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__APP_MGR, oldAppMgr, appMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DataSourceManager getDsMgr()
  {
    if (dsMgr != null && dsMgr.eIsProxy())
    {
      InternalEObject oldDsMgr = (InternalEObject)dsMgr;
      dsMgr = (DataSourceManager)eResolveProxy(oldDsMgr);
      if (dsMgr != oldDsMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__DS_MGR, oldDsMgr, dsMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return dsMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getDataSourceMgr(localsc);
     DataSourceManagerImpl dsm=new DataSourceManagerImpl();
     dsm.setCore(result);
     result=dsm;
}
catch(Exception e)
{
  result = null;
}
        dsMgr=(result instanceof EObject)?(DataSourceManager)result:(DataSourceManager)ImagePool.find(result);
        	
    return dsMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DataSourceManager basicGetDsMgr()
  {
    return dsMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDsMgr(DataSourceManager newDsMgr)
  {
    DataSourceManager oldDsMgr = dsMgr;
    dsMgr = newDsMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__DS_MGR, oldDsMgr, dsMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AdvanceServiceManager getAdvServiceMgr()
  {
    if (advServiceMgr != null && advServiceMgr.eIsProxy())
    {
      InternalEObject oldAdvServiceMgr = (InternalEObject)advServiceMgr;
      advServiceMgr = (AdvanceServiceManager)eResolveProxy(oldAdvServiceMgr);
      if (advServiceMgr != oldAdvServiceMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__ADV_SERVICE_MGR, oldAdvServiceMgr, advServiceMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return advServiceMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getAdvacneServiceMgr(localsc);
     AdvanceServiceManagerImpl ami=new AdvanceServiceManagerImpl();
     ami.setCore(result);
     result=ami;
}
catch(Exception e)
{
  result = null;
}
        advServiceMgr=(result instanceof EObject)?(AdvanceServiceManager)result:(AdvanceServiceManager)ImagePool.find(result);
        	
    return advServiceMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AdvanceServiceManager basicGetAdvServiceMgr()
  {
    return advServiceMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAdvServiceMgr(AdvanceServiceManager newAdvServiceMgr)
  {
    AdvanceServiceManager oldAdvServiceMgr = advServiceMgr;
    advServiceMgr = newAdvServiceMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__ADV_SERVICE_MGR, oldAdvServiceMgr, advServiceMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ThreadPoolManager getThreadPoolMgr()
  {
    if (threadPoolMgr != null && threadPoolMgr.eIsProxy())
    {
      InternalEObject oldThreadPoolMgr = (InternalEObject)threadPoolMgr;
      threadPoolMgr = (ThreadPoolManager)eResolveProxy(oldThreadPoolMgr);
      if (threadPoolMgr != oldThreadPoolMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__THREAD_POOL_MGR, oldThreadPoolMgr, threadPoolMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return threadPoolMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getThreadPoolMgr(localsc);
     ThreadPoolManagerImpl tmi=new ThreadPoolManagerImpl();
     tmi.setCore(result);
     result=tmi;
}
catch(Exception e)
{
  result = null;
}
        threadPoolMgr=(result instanceof EObject)?(ThreadPoolManager)result:(ThreadPoolManager)ImagePool.find(result);
        	
    return threadPoolMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ThreadPoolManager basicGetThreadPoolMgr()
  {
    return threadPoolMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setThreadPoolMgr(ThreadPoolManager newThreadPoolMgr)
  {
    ThreadPoolManager oldThreadPoolMgr = threadPoolMgr;
    threadPoolMgr = newThreadPoolMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__THREAD_POOL_MGR, oldThreadPoolMgr, threadPoolMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SystemServiceManager getSystemServiceMgr()
  {
    if (systemServiceMgr != null && systemServiceMgr.eIsProxy())
    {
      InternalEObject oldSystemServiceMgr = (InternalEObject)systemServiceMgr;
      systemServiceMgr = (SystemServiceManager)eResolveProxy(oldSystemServiceMgr);
      if (systemServiceMgr != oldSystemServiceMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__SYSTEM_SERVICE_MGR, oldSystemServiceMgr, systemServiceMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return systemServiceMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getSystemServiceMgr(localsc);
     SystemServiceManagerImpl smi=new SystemServiceManagerImpl();
     smi.setCore(result);
     result=smi;
}
catch(Exception e)
{
  result = null;
}
        systemServiceMgr=(result instanceof EObject)?(SystemServiceManager)result:(SystemServiceManager)ImagePool.find(result);
        	
    return systemServiceMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SystemServiceManager basicGetSystemServiceMgr()
  {
    return systemServiceMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSystemServiceMgr(SystemServiceManager newSystemServiceMgr)
  {
    SystemServiceManager oldSystemServiceMgr = systemServiceMgr;
    systemServiceMgr = newSystemServiceMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__SYSTEM_SERVICE_MGR, oldSystemServiceMgr, systemServiceMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JMSQueueManager getJmsQueueMgr()
  {
    if (jmsQueueMgr != null && jmsQueueMgr.eIsProxy())
    {
      InternalEObject oldJmsQueueMgr = (InternalEObject)jmsQueueMgr;
      jmsQueueMgr = (JMSQueueManager)eResolveProxy(oldJmsQueueMgr);
      if (jmsQueueMgr != oldJmsQueueMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__JMS_QUEUE_MGR, oldJmsQueueMgr, jmsQueueMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return jmsQueueMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getJMSServiceMgr(localsc);
     JMSQueueManagerImpl jmi=new JMSQueueManagerImpl();
     jmi.setCore(result);
     result=jmi;
}
catch(Exception e)
{
  result = null;
}
        jmsQueueMgr=(result instanceof EObject)?(JMSQueueManager)result:(JMSQueueManager)ImagePool.find(result);
        	
    return jmsQueueMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JMSQueueManager basicGetJmsQueueMgr()
  {
    return jmsQueueMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJmsQueueMgr(JMSQueueManager newJmsQueueMgr)
  {
    JMSQueueManager oldJmsQueueMgr = jmsQueueMgr;
    jmsQueueMgr = newJmsQueueMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__JMS_QUEUE_MGR, oldJmsQueueMgr, jmsQueueMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JMSTopicManager getJmsTopicMgr()
  {
    if (jmsTopicMgr != null && jmsTopicMgr.eIsProxy())
    {
      InternalEObject oldJmsTopicMgr = (InternalEObject)jmsTopicMgr;
      jmsTopicMgr = (JMSTopicManager)eResolveProxy(oldJmsTopicMgr);
      if (jmsTopicMgr != oldJmsTopicMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__JMS_TOPIC_MGR, oldJmsTopicMgr, jmsTopicMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return jmsTopicMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getJMSServiceMgr(localsc);
     JMSTopicManagerImpl jmi=new JMSTopicManagerImpl();
     jmi.setCore(result);
     result=jmi;
}
catch(Exception e)
{
  result = null;
}
        jmsTopicMgr=(result instanceof EObject)?(JMSTopicManager)result:(JMSTopicManager)ImagePool.find(result);
        	
    return jmsTopicMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JMSTopicManager basicGetJmsTopicMgr()
  {
    return jmsTopicMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJmsTopicMgr(JMSTopicManager newJmsTopicMgr)
  {
    JMSTopicManager oldJmsTopicMgr = jmsTopicMgr;
    jmsTopicMgr = newJmsTopicMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__JMS_TOPIC_MGR, oldJmsTopicMgr, jmsTopicMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JMSFactoryManager getJmsFactoryMgr()
  {
    if (jmsFactoryMgr != null && jmsFactoryMgr.eIsProxy())
    {
      InternalEObject oldJmsFactoryMgr = (InternalEObject)jmsFactoryMgr;
      jmsFactoryMgr = (JMSFactoryManager)eResolveProxy(oldJmsFactoryMgr);
      if (jmsFactoryMgr != oldJmsFactoryMgr)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.APUSIC_SERVER__JMS_FACTORY_MGR, oldJmsFactoryMgr, jmsFactoryMgr));
      }
    }
        Object result=null;
        Object core=(Object)getCore();
        if(core==null) return jmsFactoryMgr;	
        try
{
ServerConfig localsc = new ServerConfig("localhost", 6888, "admin", "admin");
     result = ServerFactory.getJMSServiceMgr(localsc);
     JMSFactoryManagerImpl jmi=new JMSFactoryManagerImpl();
     jmi.setCore(result);
     result=jmi;
}
catch(Exception e)
{
  result = null;
}
        jmsFactoryMgr=(result instanceof EObject)?(JMSFactoryManager)result:(JMSFactoryManager)ImagePool.find(result);
        	
    return jmsFactoryMgr; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public JMSFactoryManager basicGetJmsFactoryMgr()
  {
    return jmsFactoryMgr;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJmsFactoryMgr(JMSFactoryManager newJmsFactoryMgr)
  {
    JMSFactoryManager oldJmsFactoryMgr = jmsFactoryMgr;
    jmsFactoryMgr = newJmsFactoryMgr;
        	
      Object core=(Object)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APUSIC_SERVER__JMS_FACTORY_MGR, oldJmsFactoryMgr, jmsFactoryMgr));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.APUSIC_SERVER__OS:
        if (resolve) return getOs();
        return basicGetOs();
      case ApusicPackage.APUSIC_SERVER__JVM:
        if (resolve) return getJvm();
        return basicGetJvm();
      case ApusicPackage.APUSIC_SERVER__APP_MGR:
        if (resolve) return getAppMgr();
        return basicGetAppMgr();
      case ApusicPackage.APUSIC_SERVER__DS_MGR:
        if (resolve) return getDsMgr();
        return basicGetDsMgr();
      case ApusicPackage.APUSIC_SERVER__ADV_SERVICE_MGR:
        if (resolve) return getAdvServiceMgr();
        return basicGetAdvServiceMgr();
      case ApusicPackage.APUSIC_SERVER__THREAD_POOL_MGR:
        if (resolve) return getThreadPoolMgr();
        return basicGetThreadPoolMgr();
      case ApusicPackage.APUSIC_SERVER__SYSTEM_SERVICE_MGR:
        if (resolve) return getSystemServiceMgr();
        return basicGetSystemServiceMgr();
      case ApusicPackage.APUSIC_SERVER__JMS_QUEUE_MGR:
        if (resolve) return getJmsQueueMgr();
        return basicGetJmsQueueMgr();
      case ApusicPackage.APUSIC_SERVER__JMS_TOPIC_MGR:
        if (resolve) return getJmsTopicMgr();
        return basicGetJmsTopicMgr();
      case ApusicPackage.APUSIC_SERVER__JMS_FACTORY_MGR:
        if (resolve) return getJmsFactoryMgr();
        return basicGetJmsFactoryMgr();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.APUSIC_SERVER__OS:
        setOs((OS)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__JVM:
        setJvm((JVM)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__APP_MGR:
        setAppMgr((ApplicationManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__DS_MGR:
        setDsMgr((DataSourceManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__ADV_SERVICE_MGR:
        setAdvServiceMgr((AdvanceServiceManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__THREAD_POOL_MGR:
        setThreadPoolMgr((ThreadPoolManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__SYSTEM_SERVICE_MGR:
        setSystemServiceMgr((SystemServiceManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__JMS_QUEUE_MGR:
        setJmsQueueMgr((JMSQueueManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__JMS_TOPIC_MGR:
        setJmsTopicMgr((JMSTopicManager)newValue);
        return;
      case ApusicPackage.APUSIC_SERVER__JMS_FACTORY_MGR:
        setJmsFactoryMgr((JMSFactoryManager)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.APUSIC_SERVER__OS:
        setOs((OS)null);
        return;
      case ApusicPackage.APUSIC_SERVER__JVM:
        setJvm((JVM)null);
        return;
      case ApusicPackage.APUSIC_SERVER__APP_MGR:
        setAppMgr((ApplicationManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__DS_MGR:
        setDsMgr((DataSourceManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__ADV_SERVICE_MGR:
        setAdvServiceMgr((AdvanceServiceManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__THREAD_POOL_MGR:
        setThreadPoolMgr((ThreadPoolManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__SYSTEM_SERVICE_MGR:
        setSystemServiceMgr((SystemServiceManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__JMS_QUEUE_MGR:
        setJmsQueueMgr((JMSQueueManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__JMS_TOPIC_MGR:
        setJmsTopicMgr((JMSTopicManager)null);
        return;
      case ApusicPackage.APUSIC_SERVER__JMS_FACTORY_MGR:
        setJmsFactoryMgr((JMSFactoryManager)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.APUSIC_SERVER__OS:
        return os != null;
      case ApusicPackage.APUSIC_SERVER__JVM:
        return jvm != null;
      case ApusicPackage.APUSIC_SERVER__APP_MGR:
        return appMgr != null;
      case ApusicPackage.APUSIC_SERVER__DS_MGR:
        return dsMgr != null;
      case ApusicPackage.APUSIC_SERVER__ADV_SERVICE_MGR:
        return advServiceMgr != null;
      case ApusicPackage.APUSIC_SERVER__THREAD_POOL_MGR:
        return threadPoolMgr != null;
      case ApusicPackage.APUSIC_SERVER__SYSTEM_SERVICE_MGR:
        return systemServiceMgr != null;
      case ApusicPackage.APUSIC_SERVER__JMS_QUEUE_MGR:
        return jmsQueueMgr != null;
      case ApusicPackage.APUSIC_SERVER__JMS_TOPIC_MGR:
        return jmsTopicMgr != null;
      case ApusicPackage.APUSIC_SERVER__JMS_FACTORY_MGR:
        return jmsFactoryMgr != null;
    }
    return super.eIsSet(featureID);
  }

} //ApusicServerImpl
